import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/stock_out_order_detail_child_entity.dart';
import 'package:library_base/entities/stock_out_order_goods_detail_entity.dart';

StockOutOrderDetailChildEntity $StockOutOrderDetailChildEntityFromJson(Map<String, dynamic> json) {
  final StockOutOrderDetailChildEntity loginBeanEntity = StockOutOrderDetailChildEntity();

  final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
  if (goodsCode != null) {
    loginBeanEntity.goodsCode = goodsCode;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    loginBeanEntity.goodsName = goodsName;
  }
  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    loginBeanEntity.unit = unit;
  }

  final double? planOutCount = jsonConvert.convert<double>(json['planOutCount']);
  if (planOutCount != null) {
    loginBeanEntity.planOutCount = planOutCount;
  }
  final double? planOutWeight = jsonConvert.convert<double>(json['planOutWeight']);
  if (planOutWeight != null) {
    loginBeanEntity.planOutWeight = planOutWeight;
  }

  final double? actualOutCount = jsonConvert.convert<double>(json['actualOutCount']);
  if (actualOutCount != null) {
    loginBeanEntity.actualOutCount = actualOutCount;
  }

  final double? actualOutWeight = jsonConvert.convert<double>(json['actualOutWeight']);
  if (actualOutWeight != null) {
    loginBeanEntity.actualOutWeight = actualOutWeight;
  }

  final bool? singleEntry = jsonConvert.convert<bool>(json['singleEntry']);
  if (singleEntry != null) {
    loginBeanEntity.singleEntry = singleEntry;
  }

  final List<StockOutOrderGoodsDetailEntity> goodsDetails = jsonConvert.convertList<StockOutOrderGoodsDetailEntity>(json['goodsDetails']);
  loginBeanEntity.goodsDetails = goodsDetails;

  return loginBeanEntity;
}

Map<String, dynamic> $StockOutOrderDetailChildEntityToJson(StockOutOrderDetailChildEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['goodsCode'] = entity.goodsCode;
  data['goodsName'] = entity.goodsName;
  data['unit'] = entity.unit;
  data['planOutCount'] = entity.planOutCount;
  data['planOutWeight'] = entity.planOutWeight;
  data['actualOutCount'] = entity.actualOutCount;
  data['actualOutWeight'] = entity.actualOutWeight;
  data['goodsDetails'] = entity.goodsDetails;
  data['singleEntry'] = entity.singleEntry;
  return data;
}
